<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
     let p1 = new Promise((resolve,reject)=>{
            setTimeout(()=>{resolve('p2的状态是成功的')},200)
        })
        
        let p2 = new Promise((resolve,reject)=>{
            setTimeout(()=>{resolve('p2的状态是成功的')},3000)
        })
        let p3= new Promise((resolve,reject)=>{
            setTimeout(()=>{resolve('p2的状态是成功的')})
        })
        let p4 = new Promise((resolve,reject)=>{
            setTimeout(()=>{reject('p4的状态是失败的')},800)
        })

        
        Promise.race([p1,p2,p3,p4])
        .then((resolve,reject)=>{
            console.log(resolve,111);
        })
        .catch((reject)=>{
            console.log(reject,222);
        })
    </script>
</body>
</html>